package com.geping.etl.utils.common;



import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.UUID;

/**
 * @Author: wangzd
 * @Date: 9:48 2020/4/13
 */
public class CommonStringutil {
    // 把一个字符串的第一个字母大写、效率是最高的
    public static String getMethodName(String fieldName) {
        byte[] items = fieldName.getBytes();
        items[0] = (byte) ((char) items[0] - 'a' + 'A');
        return new String(items);
    }

    //获取uuid并去掉'-'
    public static String getUuid() {
        return UUID.randomUUID().toString().replace("-", "");
    }

    //获取当前时间并格式化
    public static String getDataTimeFormatter(String pattern){
        String format = LocalDateTime.now().format(DateTimeFormatter.ofPattern(pattern));
        return format;
    }

//    /**
//     * 根据接口编码取对应实体类
//     *
//     * @param code 接口编码
//     * @param <T>  对应实体类
//     * @return T  会计记账
//     */
//    public static <T> ReflectContent<T> getRefContent(String code) {
//        ReflectContent content = new ReflectContent();
//        switch (code) {
//            case "JGXXB":
//                content.setT(new Jgxxb());
//                content.setHisT(new Hisjgxxb());
//                content.setDataGuiUrl("east2/datamanager/publicinfo/jgxxb");
//                content.setCreateReportGuiUrl("east2/createreport/publicinfo/jgxxb");
//                content.setHisDataGuiUrl("east2/hisdata/publicinfo/jgxxb");
//                break;
//            case "ZZKJQKMB":
//                content.setT(new Zzkjqkmb());
//                content.setHisT(new Hiszzkjqkmb());
//                content.setDataGuiUrl("east2/datamanager/accountinginfo/zzkjqkmb");
//                content.setCreateReportGuiUrl("east2/createreport/accountinginfo/zzkjqkmb");
//                content.setHisDataGuiUrl("east2/hisdata/accountinginfo/zzkjqkmb");
//                break;
//            case "JXSDKKHXXB":
//                content.setT(new Jxsdkkhxxb());
//                content.setHisT(new Hisjxsdkkhxxb());
//                content.setDataGuiUrl("east2/datamanager/clientinfo/jxsdkkhxxb");
//                content.setCreateReportGuiUrl("east2/createreport/clientinfo/jxsdkkhxxb");
//                content.setHisDataGuiUrl("east2/hisdata/clientinfo/jxsdkkhxxb");
//                break;
//            case "ZJYWXXB":
//                content.setT(new Zjywxxb());
//                content.setHisT(new Hiszjywxxb());
//                content.setDataGuiUrl("east2/datamanager/capitalinfo/zjywxxb");
//                content.setCreateReportGuiUrl("east2/createreport/capitalinfo/zjywxxb");
//                content.setHisDataGuiUrl("east2/hisdata/capitalinfo/zjywxxb");
//                break;
//            case "JXSDKHTB":
//                content.setT(new Jxsdkhtb());
//                content.setHisT(new Hisjxsdkhtb());
//                content.setDataGuiUrl("east2/datamanager/dealinfo/jxsdkhtb");
//                content.setCreateReportGuiUrl("east2/createreport/dealinfo/jxsdkhtb_bw");
//                content.setHisDataGuiUrl("east2/hisdata/dealinfo/jxsdkhtb_his");
//                break;
//            case "JXSEDXXB":
//                content.setT(new Jxsedxxb());
//                content.setHisT(new Hisjxsedxxb());
//                content.setDataGuiUrl("east2/datamanager/creditinfo/jxsedxxb");
//                content.setCreateReportGuiUrl("east2/createreport/creditinfo/jxsedxxb_bw");
//                content.setHisDataGuiUrl("east2/hisdata/creditinfo/jxsedxxb_his");
//                break;
//            default:
//                break;
//        }
//        return content;
//    }
}

